home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 144_01 / sub.hlp < prev    next >
Text File  |  1985-08-19  |  3KB  |  60 lines

  1. **********************************************************************
  2. *                             SUB                                    *
  3. **********************************************************************
  4. *                  COPYRIGHT 1983 EUGENE H. MALLORY                  *
  5. **********************************************************************
  6. PROGRAM:
  7.     SUB    Finds and substitutes text strings in I/O stream.
  8. USAGE:
  9.     SUB    [<fid] pattern [replace] [-H] [>fid]
  10. FUNCTION:
  11.     This searches the input for the supplied pattern and replaces it 
  12.     with the replacement string. All occurances of the pattern will
  13.     be replaced.
  14.     The -H options will display the meta characters.
  15.     The pattern is very general.  
  16.     
  17.     There are the following meta characters.
  18.     *    Any number of any characters, from 0 to 132.
  19.     ?    Any single character.
  20.     _    A space character.
  21.     \    Literal character.  Used to include *, ? etc. in pattern.
  22.     {    Beginning of line.
  23.     }    End of line.
  24.     @    Any alpha character.
  25.     #    Any number.
  26.     !    NOT  This may be used with any printable character, _,
  27.         {, }, @, and #,  as well as \char forms.  This can be used 
  28.     to find    strings NOT at the beginnnin# or end of a line.
  29.     
  30.     The replacement string is optional.  If missing, the matched 
  31.     pattern(s) is deleted from the line.
  32.     
  33.     Because CP/M translates characters into upper case and 
  34.     deletes spaces, and because the I/O redirection and pipes use <, 
  35.     >, and + as markers, some special conventions are provided to get 
  36.     around these restrictions.  These are:
  37.     
  38.     \    Literal follows.  Used with restricted characters like \+ .
  39.     _    Space.  May be used as a space.  Use \_ if you want a literal _.
  40.     ~   Lowercase flag.  Letter which follows goes into lower case.
  41.     *   Insert match string here.  May be used more than once.
  42. EXAMPLE:
  43.     LS *.DOC |SUB * CLEAN_<*_>* >CLEAN.SUB {Creates submit file to}
  44.                               {CLEAN all .DOC files. }
  45. COMMENTS:
  46.     All pattern matching is done in uppercase mode.  "abc" will
  47.     always match "ABC".
  48.  
  49.         Command Line                       
  50. ___________________________________  
  51.                                   |  
  52.                                   |  PATTERN AND REPLACEMENT STRING
  53.                     ______________V______________    
  54.  Standard Input     |                           |   Standard Output
  55.      TEXT           |                           |    SUBSTITUTED TEXT
  56. ------------------->|            SUB            |----------------------->
  57.                     |                           |
  58.                     |                           |
  59.                     |___________________________|
  60.